package com.itany.life.sessionredis1.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
public class RedisController {

    @Autowired
    private RedisTemplate redisTemplate;

    @RequestMapping("/f1")
    public void f1(HttpSession session){
        System.out.println("RadisController.f1()");





        session.setAttribute("a","abc");
        redisTemplate.opsForValue().set("b","abc");


    }
}
